package com.steakliu.sun.disuse;

import com.steakliu.sun.disuse.api.DisuseStrategy;
import com.steakliu.sun.disuse.api.ConnectionsInfo;
import com.steakliu.sun.spi.annotation.Join;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * 功能说明： 默认的连接淘汰策略
 * <p>
 * Original @Author: steakliu-刘牌, 2023-02-05  20:02
 * <p>
 * Copyright (C)2020-2022  steakliu All rights reserved.
 */
@Join
public class DefaultDisuseStrategy implements DisuseStrategy {

    private final Logger LOGGER = LoggerFactory.getLogger(DefaultDisuseStrategy.class);

    @Override
    public ConnectionsInfo selectConnection(List<ConnectionsInfo> connectionsInfoList) {
        LOGGER.info("use default connections disuse strategy!");
        return connectionsInfoList.get(0);
    }
}
